package com.youdoneed.community.feign;

import com.youdoneed.base.application.ResultMessage;
import com.youdoneed.community.forum.entity.Forumcomment;
import com.youdoneed.community.forum.entity.Forumnotice;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 说明。
 *
 * @author Ewing
 * @date 2017/4/26
 */
@FeignClient(value = "community", fallback = ForumFallback.class)
public interface ForumClient {

    @RequestMapping(value = "/forummessage/getTotalAttentionMe", method = RequestMethod.GET)
    ResultMessage<Integer> getTotalAttentionMe(@RequestParam("userId") String userId);

    @RequestMapping(value = "/forummessage/getTotalAgreeMe", method = RequestMethod.GET)
    ResultMessage<Integer> getTotalAgreeMe(@RequestParam("userId") String userId);

    //查询推荐关注
    @RequestMapping(value = "/forumuserattentionanotherrel/findRecommendAttention", method = RequestMethod.GET)
    ResultMessage<List<Map<String, Object>>> findRecommendAttention(
            @RequestParam(value = "currentPage", required = false) Integer currentPage,
            @RequestParam(value = "rows", required = false) Integer rows);

    //加关注
    @RequestMapping(value = "/forumuserattentionanotherrel/saveUserAttention", method = RequestMethod.GET)
    ResultMessage<String> saveUserAttention(@RequestParam("attentionedUserId") String attentionedUserId,
                                            @RequestParam("userId") String userId);

    //取消关注
    @RequestMapping(value = "/forumuserattentionanotherrel/deleteUserAttentionForFriends", method = RequestMethod.GET)
    ResultMessage<String> deleteUserAttentionForFriends(@RequestParam("attentionedUserId") String attentionedUserId,
                                                        @RequestParam("userId") String userId);

    //判断是否关注
    @RequestMapping(value = "/forumuserattentionanotherrel/isFocusOrNot", method = RequestMethod.GET)
    ResultMessage<String> isFocusOrNot(@RequestParam("userId") String userId,
                                       @RequestParam("friendId") String friendId);

    @RequestMapping(value = "/forumuserattentionanotherrel/getMyAttentionUsers", method = RequestMethod.POST)
    ResultMessage<List<String>> getMyAttentionUsers(@RequestParam("userId") String userId);

    @RequestMapping(value = "/forumcomment/getFrindsCommentInNews", method = RequestMethod.POST)
    ResultMessage<List<Forumcomment>> getFrindsCommentInNews(@RequestParam("userId") String userId,
                                                             @RequestParam("postId") String postId);

    @RequestMapping(value = "/shield/hasShield", method = RequestMethod.POST)
    ResultMessage<Boolean> hasShield(@RequestParam("userId") String userId,
                                     @RequestParam("shildUserId") String shildUserId);

    @RequestMapping(value = "/likesPointRecord/hasPraised", method = RequestMethod.POST)
    ResultMessage<Integer> hasPraised(@RequestParam("userId") String userId,
                                      @RequestParam("postsId") String postsId);

    @RequestMapping(value = "/forummessage/updateUserInfo", method = RequestMethod.POST)
    ResultMessage<?> updateUserInfo(@RequestParam("userId") String userId,
                                      @RequestParam("nickName") String nickName,
                                      @RequestParam("userHeadUrl") String userHeadUrl);

    @RequestMapping(value = "/forumNotice/saveNotice", method = RequestMethod.POST)
    ResultMessage<?> saveNotice(@RequestBody Forumnotice forumnotice);

    @RequestMapping(value = "/share/pushMessageForExtraMsg", method = RequestMethod.POST)
    ResultMessage<Boolean> pushMessageForExtraMsg(@RequestParam("id")String id,
                                            @RequestParam("title")String title,
                                            @RequestParam("msg")String msg,
                                            @RequestParam("msgType")String msgType);
}
